package testy;
import java.awt.BorderLayout;

import javax.swing.DefaultComboBoxModel;
import javax.swing.JList;
import javax.swing.ListModel;
import javax.swing.WindowConstants;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import cii_functions.IDataCommuniactor;
import cii_lib.CIIdata;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class NewJFramett extends javax.swing.JFrame implements IDataCommuniactor {
	
	private static final Logger log = LoggerFactory
			.getLogger(NewJFramett.class);
	
	private JList jList1;

	/**
	* Auto-generated main method to display this JFrame
	*/
	public static void main(String[] args) {
				NewJFramett inst = new NewJFramett();
				inst.setLocationRelativeTo(null);
				inst.setVisible(true);
	}
	
	public NewJFramett() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			{
				ListModel jList1Model = 
					new DefaultComboBoxModel();
				jList1 = new JList();
				getContentPane().add(jList1, BorderLayout.CENTER);
				jList1.setModel(jList1Model);
			}
			pack();
			setSize(400, 300);
		} catch (Exception e) {
			log.error("", e);
		}
	}

	/* (non-Javadoc)
	 * @see cii_functions.IDataCommuniactor#writeData(cii_lib.CIIdata, java.lang.String)
	 */
	@Override
	public void writeData(CIIdata data, String id) {
		DefaultComboBoxModel boxModel = (DefaultComboBoxModel)jList1.getModel();
		boxModel.addElement(" "+id+" : "+data.GetBin0());
	}

}
